# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname=ailment
pkgname=python-${_pyname}
pkgver=9.2.66
pkgrel=1
pkgdesc='The angr intermediate language'
url='https://github.com/angr/ailment'
license=('custom:BSD2')
arch=('any')
depends=('python' 'python-claripy' 'python-pyvex' 'python-pypcode')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest' 'python-archinfo')
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('580241fc05a3c47241531cea2372f503e1ff3e42b431a1373c38225b276f47d3b986305e8adb0fe7a560c866aa3b85d9f5c712e5b2a3b4bce4d0b81b9f3b2437')
b2sums=('77114288b037bfc137e756edd9d369820eb293eb8a9b447cadcd89a34df1e2d1aa915028375f29eba9abcdb1515b343655eb5c389b6b6f0c375b43e4bbae2160')

build() {
  cd ${_pyname}-${pkgver}
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pyname}-${pkgver}
  # TODO: needed for angr (hard dep)
  # PYTHONPATH=build/lib pytest
}

package() {
  cd ${_pyname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
